package com.platform.dao.mybatis.impl;

import com.platform.dao.FunctionDao;
import com.platform.dao.mybatis.mapper.FunctionMapper;
import com.platform.domain.model.Function;
import com.platform.domain.model.FunctionExpand;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;


/**
* Function
*
* User: wangyang
* DateTime: 2012-10-08 16:11:49
*
*/
@Service("functionDao")
public class FunctionDaoImpl implements FunctionDao {

    @Resource
    private FunctionMapper functionMapper;

    /**
     * 根据条件查询符合条件的功能菜单信息集合
     * @param params 查询参数Map
     * @return 功能菜单信息集合
     * @throws Exception
     */
    public List<FunctionExpand> selectFunctions(Map<String, String> params) throws Exception {
        return functionMapper.selectFunctions(params);
    }

    /**
     * 根据条件查询符合条件的功能信息集合
     *
     * @param params 查询参数Map
     * @return 功能菜单信息集合
     * @throws Exception
     */
    @Override
    public List<FunctionExpand> selectRoleFunctions(Map<String, String> params) throws Exception {
        return functionMapper.selectRoleFunctions(params);
    }

    /**
    *
    * 根据主键查询Function对象
    *
    * @param functionId
    * @return Function对象
    */
    @Override
    public Function selectByPrimaryKey(String functionId) throws Exception {
        return functionMapper.selectByPrimaryKey(functionId);
    }

    /**
    *
    * 根据查询条件查询符合条件的Function对象
    *
    * @param function
    * @return 符合条件的Function对象List
    */
    @Override
    public List<Function> select(Function function) throws Exception {
        return functionMapper.select(function);
    }

    /**
    *
    * 根据主键删除Function对象
    *
    * @param functionId
    * @return 影响条件数
    */
    @Override
    public int deleteByPrimaryKey(String functionId) throws Exception {
        return functionMapper.deleteByPrimaryKey(functionId);
    }

    /**
    *
    * 根据条件删除符合条件的Function对象
    *
    * @param function
    * @return 影响条件数
    */
    @Override
    public int delete(Function function) throws Exception {
        return functionMapper.delete(function);
    }

    /**
    *
    * 插入Function对象
    *
    * @param function
    * @return 影响条件数
    */
    @Override
    public int insert(Function function) throws Exception {
        return functionMapper.insert(function);
    }

    /**
    *
    * 更新Function对象
    *
    * @param function
    * @return 影响条件数
    */
    @Override
    public int update(Function function) throws Exception {
        return functionMapper.update(function);
    }
}
